---
id: 65824561f3478e5371a33ae5
title: الخطوة 23
challengeType: 20
dashedName: step-23
---

# --description--

The next step is to define the main function, which will be the entry point of the interactive expense tracker program.

Define a function named `main` without parameters. Fill the function body with the `expenses` list you created at the beginning of this project. You will use this list to store the expense records.

# --hints--

You should define a function named `main()` without parameters.

```js
({ test: () => assert(__pyodide.runPython(`
    import inspect    
    inspect.isfunction(main)
  `))
})
```

You should move the `expenses` list inside the `main()` function body.

```js
({ test: () => assert(__pyodide.runPython(`
    import inspect    
    sig = str(inspect.signature(main))
    sig == '()'
  `))
})
```

# --seed--

## --seed-contents--

```py
def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})

def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')

def total_expenses(expenses):
    return sum(map(lambda expense: expense['amount'], expenses))

def filter_expenses_by_category(expenses, category):
    return filter(lambda expense: expense['category'] == category, expenses)
--fcc-editable-region--

expenses = []
--fcc-editable-region--
```
